<template>
  <div class="tab-content-wrap">
    <el-table
      :data="tableData"
      v-loading="loading"
    >
      <el-table-column label="模块名称" align="center" prop="modelName"/>

      <el-table-column label="模块状态" align="center" prop="modelStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.common_status" :value="scope.row.modelStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="驱动名称" align="center" prop="driveName"/>
      <el-table-column label="插件库名称" align="center" prop="adapterName"/>
      <el-table-column label="当前插件库版本" align="center" prop="adapterVersion"/>
      <el-table-column label="异常信息" align="center" prop="message"/>
      <el-table-column label="异常代码" align="center" prop="errorCode"/>
      <el-table-column label="状态及自检数据更新时间" align="center" prop="updateTime"/>
    </el-table>
  </div>
</template>

<script>
import UPageConfig from '@/components/uPageConfig/index'
import {reqDeploymentModuleByDeviceId} from '@/api/operationAndMonitoring/deviceMonitoring'
import TableContent from "@/components/uPageConfig/table/index";

export default {
  name: "modelInfo",
  dicts: ['common_status'],
  components: {TableContent},
  props: {
    // 模块列表
    deviceId: {
      type: String,
      default: ''
    },
  },
  data() {
    return {
      tableData: [],
      loading: false
    }
  },
  methods: {
    /** 查询设备模块列表 */
    getList() {
      this.loading = true;
      reqDeploymentModuleByDeviceId({deviceId: this.deviceId}).then(response => {
        // console.log(56, response)
          this.tableData = response.data;
        }
      ).finally(()=>{
        this.loading = false;
      })
    },
  },
  created() {
    this.getList()
  }
}
</script>
